<template>
    <div class="box">
        <div>msg: {{ msg }}</div>
        <h3>儿子小明: 有存款: {{ money }}</h3>
        <button @click="giveMoney(50)">给BABA钱: 50</button>
    </div>
</template>

<script>
import mixin from './mixin'
export default {
    name: 'Son',
    mixins: [mixin],
    data() {
        return {
            // money: 30000
        }
    },
    mounted() {
        console.log('son组件内的钩子');
    }
    // methods: {
    //     giveMoney(num) {
    //         console.log(this.$parent);
    //         this.money -= num

    //         this.$parent.money += num
    //     }
    // }
}
</script>
